export default {
  namespaced: true,
  state: {
    token: undefined, // 平台账户，尚未有登录功能
    business_id: undefined, // 当前选择的业务
    account_id: '', // 当前选择的云账号
    collapse: localStorage.getItem('collapse') === 'true',

    <% if (darkMode) { %>  
    theme: ''
    <% } %>
  },
  mutations: {
    setBusinessId (state, playLoad) {
      state.business_id = playLoad
    },
    setAccountId (state, playLoad) {
      state.account_id = playLoad
    },

    setCollapse (state) {
      localStorage.setItem('collapse', state.collapse ? 'false' : 'true')
      state.collapse = !state.collapse
    },

    <% if (darkMode) { %>
    setTheme (state, theme) {
      document.documentElement.setAttribute('data-theme', theme)
      state.theme = theme
      localStorage.setItem('theme', theme)
    }
    <% } %>

  }
}
